const Router = require('koa-router')

const { verifyAuth } = require('../middlewares/auth.middleware')

const TestRouter = new Router({ prefix: '/test' })

TestRouter.get('/', async (ctx, next) => {
	const { name, age } = ctx.request.query

	ctx.set('content-type', 'application/json;charset=utf-8')
	ctx.body = {
		statusCode: 200,
		data: {
			name,
			age,
		},
	}
})

TestRouter.post('/', async (ctx, next) => {
	const data = ctx.request.body
	// console.log('data---', data);
	ctx.set('content-type', 'application/json;charset=utf-8')
	ctx.body = {
		statusCode: 200,
		data,
	}
})



module.exports = TestRouter
